Machine learning device and thermal displacement compensation device

ABSTRACT

A machine learning device includes: a measured data acquisition unit that acquires a measured data group; a thermal displacement acquisition unit that acquires a thermal displacement actual measured value about a machine element; a storage unit that uses the measured data group acquired by the measured data acquisition unit as input data, uses the thermal displacement actual measured value about the machine element acquired by the thermal displacement acquisition unit as a label, and stores the input data and the label in association with each other as teaching data; and a calculation formula learning unit that performs machine learning based on the measured data group and the thermal displacement actual measured value about the machine element, thereby setting a thermal displacement estimation calculation formula used for calculating the thermal displacement of the machine element based on the measured data group.

This application is based on and claims the benefit of priority fromJapanese Patent Application No. 2017-054266, filed on 21 Mar. 2017, thecontent of which is incorporated herein by reference.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to a machine learning device and a thermaldisplacement compensation device used for a machine tool.

Related Art

One of the main factors of a machining error in a machine tool has beenrelative thermal displacement caused between a tool and a workpiece bythermal expansion of a machine element in the machine tool. Specificexamples of a component in the machine tool include a spindle, a spindleunit, a bed, a column, a work table, and a tool. These components,especially the spindle, are thermally deformed by generation of heat byrotation of the spindle, generation of heat from a spindle drive motor,absorption of heat by a coolant supplied from a coolant supplier to thetool, and absorption of heat by a lubrication oil supplied from alubrication oil supplier to a spindle bearing, for example. As a result,in some cases, relative thermal displacement is caused between the tooland the workpiece.

According to a technique conventionally used in response to this issue,a command value for a numerical controller for control of a machine toolis compensated in consideration of influence by thermal expansion of aspindle caused by various heat sources such as a heat source near thespindle in the machine tool and outside air temperature, therebyincreasing machine accuracy (see Patent Document 1, for example).

-   Patent Document 1: Japanese Unexamined Patent Application,    Publication No. H07-75937

SUMMARY OF THE INVENTION

However, Patent Document 1 merely mentions installation of multipletemperature sensors as a method of acquiring a characteristic valueabout the machine tool. Hence, the technique of Patent Document 1 doesnot ensure highly accurate compensation.

Further, it takes time for heat measured by the temperature sensor to betransferred and to cause thermal expansion. Hence, it is required toevaluate time delay for highly accurate compensation, leading to acomplicated compensation formula.

Additionally, a structure or a member changes depending on the machineon which numerical controllers are to be installed. Hence, an optimumthermal displacement compensation formula is changed in response to amachine type.

Additionally, an external heat source is changed by the environment ofuse such as an ambient heat generation source or the presence of agateway, for example. This necessitates change in the appropriatelocation for a temperature sensor, thereby necessitating change in anoptimum compensation formula. Further, increasing the number ofmeasurement instruments for locating the temperature sensor at anappropriate position leads to an increase in production cost andmaintenance cost.

In view of the foregoing circumstances, the present invention isintended to provide a machine learning device and a thermal displacementcompensation device capable not only of deriving a highly accuratecompensation formula but also achieving highly accurate compensationitself at low cost.

(1) A machine learning device according to the present invention is amachine learning device (machine learning device 10, 10A, 10B describedlater, for example) that optimizes, by machine learning, a calculationformula used for estimating the thermal displacement of a machineelement to be thermally expanded in a machine tool (machine tool 35described later, for example) based on a measured data group containingtemperature data about the machine element and its surroundings and/oroperating state data about the machine element. The machine learningdevice comprises: a measured data acquisition unit (measured dataacquisition unit 11 described later, for example) that acquires themeasured data group; a thermal displacement acquisition unit (thermaldisplacement acquisition unit 12 described later, for example) thatacquires a thermal displacement actual measured value about the machineelement; a storage unit (storage unit 13 described later, for example)that uses the measured data group acquired by the measured dataacquisition unit as input data, uses the thermal displacement actualmeasured value about the machine element acquired by the thermaldisplacement acquisition unit as a label, and stores the input data andthe label in association with each other as teaching data; and acalculation formula learning unit (calculation formula learning unit 14described later, for example) that performs machine learning based onthe measured data group and the thermal displacement actual measuredvalue about the machine element, thereby setting a thermal displacementestimation calculation formula used for calculating the thermaldisplacement of the machine element based on the measured data group.The calculation formula learning unit sets the thermal displacementestimation calculation formula based on a difference between a thermaldisplacement estimated value about the machine element calculated bysubstituting the measured data group in a predetermined period stored asthe teaching data in the storage unit into the thermal displacementestimation calculation formula and the thermal displacement actualmeasured value about the machine element in the predetermined periodstored as the label in the storage unit.

(2) In the machine learning device described in (1), the measured dataacquisition unit (measured data acquisition unit 11 described later, forexample) may further acquire a second measured data group by addingmeasured data to the measured data group and/or by excluding measureddata from the measured data group. The measured data acquisition unitmay store the second measured data group as input data into the storageunit (storage unit 13 described later, for example). The calculationformula learning unit (calculation formula learning unit 14 describedlater, for example) may further set a second thermal displacementestimation calculation formula used for calculating the thermaldisplacement of the machine tool based on the second measured datagroup.

(3) The machine learning device described in (2) may further comprise acontribution determination unit (contribution determination unit 15described later, for example) that determines a contribution toestimation of the thermal displacement of measured data in the measureddata group. The contribution determination unit may determine thecontribution of measured data as a contribution calculation target basedon a difference between a first error and a second error. The firsterror is an error between a first thermal displacement estimated valueand a thermal displacement actual measured value. The first thermaldisplacement estimated value is calculated using a first thermaldisplacement estimation calculation formula set based on a measured datagroup containing the measured data as a contribution calculation target.The second error is an error between a second thermal displacementestimated value and a thermal displacement actual measured value. Thesecond thermal displacement estimated value is calculated using thesecond thermal displacement estimation calculation formula set based onthe second measured data group from which the measured data as acontribution calculation target has been excluded.

(4) The machine learning device described in (3) may further comprise anoptimized measured data selection unit (optimized measured dataselection unit 16 described later, for example) that selects anoptimized measured data group containing a combination of measured datapieces belonging to a measured data group currently acquired andachieving an optimum degree of accuracy using a predetermined number ofmeasured data pieces. The optimized measured data selection unit mayselect a first measured data group by excluding measured data with thesmallest contribution as determined by the contribution determinationunit from the measured data group currently acquired. The optimizedmeasured data selection unit may select an (i+1)-th measured data groupby excluding measured data with the smallest contribution as determinedby the contribution determination unit from an i-th (1≤i) measured datagroup, and make this selection repeatedly, thereby selecting theoptimized measured data group containing the predetermined number ofmeasured data pieces.

(5) In the machine learning device described in (1) to (4), the thermaldisplacement estimation calculation formula may use a first-order lagelement in measured data in the measured data group.

(6) In the machine learning device described in (1) to (5), the thermaldisplacement estimation calculation formula may use a time shift elementin measured data in the measured data group.

(7) In the machine learning device described in (1) to (6), the thermaldisplacement estimation calculation formula may be set based on machinelearning using a neural network.

(8) In the machine learning device described in (1) to (6), thecalculation formula learning unit (calculation formula learning unit 14described later, for example) may set the thermal displacementestimation calculation formula based on machine learning using L2regularization multiple regression analysis.

(9) In the machine learning device described in (1) to (6), thecalculation formula learning unit (calculation formula learning unit 14described later, for example) may set the thermal displacementestimation calculation formula using sparse regularization learning.

(10) The machine learning device described in (9) may further comprise adetection unit (detection unit 17 described later, for example) thatdetects measured data in the measured data group that do not contributeto an increase in the accuracy of thermal displacement estimation. Thedetection unit may detect the measured data based on the thermaldisplacement estimation calculation formula set by sparse regularizationlearning.

(11) The machine learning device described in (1) to (10) may beincorporated in a controller (controller 30 described later, forexample) for the machine tool (machine tool 35 described later, forexample).

(12) A thermal displacement compensation device according to the presentinvention comprises: a compensation value calculation unit (compensationvalue calculation unit 22 described later, for example), where based onthe thermal displacement estimation calculation formula set by themachine learning device described in (1) to (11) (machine learningdevice 10, 10A, 10B described later, for example), the compensationvalue calculation unit calculates a compensation value corresponding tothe thermal displacement of the machine element calculated from themeasured data group; and a compensation unit (compensation unit 24described later, for example) that compensates the machine position ofthe machine element based on the compensation value about the machineelement calculated by the compensation value calculation unit.

(13) The thermal displacement compensation device described in (12) maybe incorporated in the controller (controller 30 described later, forexample) for the machine tool (machine tool 35 described later, forexample).

According to the present invention, not only highly accurate derivationof a compensation formula but also highly accurate compensation itselfcan be achieved at low cost.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a thermal displacement compensationsystem according to a first embodiment of the present invention;

FIG. 2 is a block diagram showing a machine learning device and athermal displacement compensation device according to the firstembodiment of the present invention in detail;

FIG. 3 is a block diagram showing a machine tool and a controlleraccording to the first embodiment of the present invention in detail;

FIG. 4 is a flowchart showing the operation of machine learning by themachine learning device according to the first embodiment of the presentinvention;

FIG. 5 is a flowchart showing an example of a neural network used forthe machine learning according to the first embodiment of the presentinvention;

FIG. 6A is a flowchart showing an example of a neural network used forthe machine learning according to the first embodiment of the presentinvention;

FIG. 6B is a flowchart showing an example of a neural network used forthe machine learning according to the first embodiment of the presentinvention;

FIG. 7 is a flowchart showing the operation of compensation by thethermal displacement compensation device according to the firstembodiment of the present invention;

FIG. 8 is a block diagram showing a machine learning device according toa second embodiment of the present invention in detail;

FIG. 9 is a flowchart showing the operation of contributiondetermination by the machine learning device according to the secondembodiment of the present invention;

FIG. 10 is a flowchart showing the operation of optimized measured datagroup selection by the machine learning device according to the secondembodiment of the present invention;

FIG. 11 is a block diagram showing a machine learning device accordingto a third embodiment of the present invention in detail; and

FIG. 12 is a flowchart showing the operation of detection of measureddata that do not contribute to an increase in accuracy by the machinelearning device according to the third embodiment of the presentinvention.

DETAILED DESCRIPTION OF THE INVENTION First Embodiment

A first embodiment of the present invention will be described belowbased on the drawings. FIG. 1 is a block diagram showing a thermaldisplacement compensation system according to this embodiment. FIG. 2 isa block diagram showing a machine learning device and a thermaldisplacement compensation device according to this embodiment in detail.FIG. 3 is a block diagram showing a machine tool and a controlleraccording to this embodiment in detail.

<Configuration of Thermal Displacement Compensation System 100>

The configuration of a thermal displacement compensation system 100according to this embodiment is described first. As shown in FIG. 1 ,the thermal displacement compensation system 100 includes a machinelearning device 10, a thermal displacement compensation device 20, acontroller 30, a machine tool 35, and a network 40. The number ofmachine learning devices 10, that of the thermal displacementcompensation devices 20, that of the controllers 30, and that of themachine tools 35 may be one, or two or more.

One controller 30 and one machine tool 35 form a pair and are connectedin a manner that allows communication therebetween. Multiple pairs eachincluding one controller 30 and one machine tool 35 may be installed inthe same factory or different factories, for example.

The machine learning device 10, the thermal displacement compensationdevice 20, the controller 30, and the machine tool 35 are connected tothe network 40 and are allowed to communicate with each other throughthe network 40. For example, the network 40 is a local area network(LAN) constructed in a factory, the Internet, a public telephonenetwork, or a combination of these networks. There is no particularlimitation on the communication through the network 40 in terms of aspecific communication system or in terms of whether the communicationis established via wires or without wires. The thermal displacementcompensation device 20 and the controller 30 may not be configured tocommunicate with each other using the network 40 but may be configuredto be directly connected through a connection unit. The machine learningdevice 10 and the controller 30 may be directly connected through aconnection unit.

The functions of these devices in the thermal displacement compensationsystem 100 will be described next based on FIG. 2 .

FIG. 2 is a block diagram showing a functional block in each device. Allthe thermal displacement compensation devices 20 have the same function.Thus, only one thermal displacement compensation device 20 is shown inFIG. 2 . Likewise, all the controllers 30 have the same function and allthe machine tools 35 have the same function. Thus, only one controller30 and only one machine tool 35 are shown in FIG. 2 . The network 40existing between the devices is omitted from FIG. 2 .

As shown in FIG. 3 , the machine tool 35 performs machining using aspindle to which a cutter is attached and which is rotated by a spindlemotor 37, and a feed axis for feeding the spindle. Specifically, thecutter is rotated by the spindle motor 37 for driving the spindle 36,and is fed by a feed axis motor 39 for driving the feed axis 38. Whilethe machine tool 35 is described as a cutting machine in theembodiments, the machine tool 35 is not limited to the cutting machine.

As shown in FIGS. 2 and 3 , the controller 30 feeds a control signal tothe machine tool 35, thereby controlling the machine tool 35 so as tomake the machine tool 35 perform the predetermined machining. Thecontroller 30 stores multiple machining programs 31 determined inresponse to the detail of machining on a workpiece. The controller 30includes: a program reading and interpretation unit 32 that reads andinterprets the machining programs 31, thereby extracting conditions formachining (the frequency of acceleration or deceleration of the spindle,a spindle speed, cutting load, and cutting time, for example) andoutputting position command data, etc. to the thermal displacementcompensation device 20; a motor control unit 33 that generates anoperation command for driving the spindle motor 37 and the feed axismotor 39 in the machine tool 35 based on position command data outputfrom the thermal displacement compensation device 20 resulting fromthermal displacement compensation; a motor drive amplifier 34A thatamplifies the operation command and outputs the amplified operationcommand to the spindle motor 37 in the machine tool 35; and a motordrive amplifier 34B that amplifies the operation command and outputs theamplified operation command to the feed axis motor 39. The programreading and interpretation unit 32 may extract conditions for machining(the frequency of acceleration or deceleration of the spindle, a spindlespeed, cutting load, and cutting time, for example) and output theextracted conditions to the thermal displacement compensation device 20.Regarding the conditions such as a spindle speed and cutting time, thecontroller 30 may output information about these conditions obtained inreal time from the spindle motor 37 and/or the feed axis motor 39 to thethermal displacement compensation device 20. For acquisition of measureddata, the controller 30 includes multiple terminals for connections tosensors attached to the machine tool 35. A sensor can be newly connectedto the controller 30, a sensor can be removed from the controller 30, orthe location of a sensor can be changed by inserting or pulling out acable of the sensor from the terminals. The arrangement of the sensorsinstalled on the machine tool 35 can also be changed. The locationchange of a sensor can be such that the sensor is removed from thelocation in the machine tool 35 and the removed sensor is added to achanged location.

As shown in FIG. 2 , the machine learning device 10 learns a thermaldisplacement estimation calculation formula for the machine tool 35 bymachine learning with a teacher. For this learning, the machine learningdevice 10 includes a measured data acquisition unit 11, a thermaldisplacement acquisition unit 12, a storage unit 13, and a calculationformula learning unit 14.

The measured data acquisition unit 11 acquires a measured data groupfrom the controller 30. The measured data mentioned herein may containtemperature data about a machine element in the machine tool 35 and itssurroundings measured by a temperature sensor. The measured data mayalso contain operating state data about a machine element in the machinetool 35, more specifically, a physical value such as a spindle speed,the flow rate of a coolant to the spindle, or the amount of alubrication oil to the spindle bearing in the machine tool 35 measuredat a place where a temperature sensor cannot be attached, for example.

The thermal displacement acquisition unit 12 acquires a thermaldisplacement actual measured value about a machine element in themachine tool 35 measured with a probe, for example.

The storage unit 13 uses the measured data group acquired by themeasured data acquisition unit 11 as input data, uses the thermaldisplacement actual measured value about the machine element acquired bythe thermal displacement acquisition unit 12 as a label, and stores theinput data and the label in association with each other as teachingdata.

The calculation formula learning unit 14 performs machine learning basedon the measured data group and the thermal displacement actual measuredvalue about the machine element, thereby setting a thermal displacementestimation calculation formula used for calculating the thermaldisplacement of the machine element based on the measured data group.More specifically, the calculation formula learning unit 14 sets thethermal displacement estimation calculation formula as follows. Due tothe presence of multiple independent variables in the measured datagroup, the calculation formula learning unit 14 performs multipleregression of a generalized linear model. Based on a difference betweena thermal displacement estimated value about the machine elementcalculated by substituting the measured data group in a predeterminedperiod stored as teaching data in the storage unit 13 into the thermaldisplacement estimation calculation formula to be obtained and thethermal displacement actual measured value about the machine element inthe predetermined period stored as a label in the storage unit 13, thecalculation formula learning unit 14 sets the thermal displacementestimation calculation formula so as to minimize this difference by theleast-square method, for example. More specifically, on the assumptionthat measured data (input data) is X₁, X₂, . . . , X_(n), a thermaldisplacement estimated value about each component forming the machinetool 35 such as a spindle, a bed, or a column is f (X₁, X₂, . . . ,X_(n)) (n is a natural number), and a thermal displacement actualmeasured value is Y_(L), the calculation formula learning unit 14 setsthe thermal displacement estimation calculation formula that minimizes adifference between f (X₁, X₂, . . . , X_(n)) and Y_(L).

As shown in FIG. 2 , the thermal displacement compensation device 20includes a compensation value calculation unit 22 as a compensationvalue calculation means and a compensation unit 24 as a compensationexecution means. The compensation value calculation unit 22 calculates acompensation value corresponding to the thermal displacement of themachine element calculated from the measured data group (determinationdata) based on the thermal displacement estimation calculation formulaset by the machine learning device 10. The compensation unit 24compensates the machine position of the machine element based on thecompensation value about the machine element calculated by thecompensation value calculation unit 22. Alternatively, the compensationunit 24 transmits this compensation value about the machine element tothe controller 30. More specifically, as shown in FIG. 3 , thecompensation unit 24 compensates a condition for machining output fromthe program reading and interpretation unit 32 of the controller 30using this compensation value about the machine element, and thenoutputs position command data to the motor control unit 33.

<Operation of Machine Learning>

The operation of machine learning in the thermal displacementcompensation system 100 according to this embodiment will be describednext. FIG. 4 is a flowchart showing the operation of the machinelearning by the machine learning device 10.

In step S11, the measured data acquisition unit 11 of the machinelearning device 10 acquires a measured data group from the controller30. More specifically, the measured data acquisition unit 11 acquirestemperature data about a machine element in the machine tool 35 and itssurroundings and/or operating state data. The operating state data maycontain a spindle speed, the flow rate of a coolant, and the flow rateof a lubrication oil, for example. The measured data to be acquired maynot be data about a temperature itself but may be data about atemperature change, for example. The data about a temperature change tobe acquired may be data about a temperature change from an initialtemperature or may be data about a temperature change from a previouslymeasured temperature to a currently measured temperature. The operatingstate data may also contain the amount of heat absorbed by a coolant orthe amount of heat absorbed by a lubrication oil.

In step S12, the thermal displacement acquisition unit 12 of the machinelearning device 10 acquires a thermal displacement actual measured valueabout the machine element in the machine tool 35 measured with a probe,for example. As a specific example, the thermal displacement acquisitionunit 12 may measure a component in an X-axis direction, a component in aY-axis direction, and a component in a Z-axis direction of the thermaldisplacement, and acquire a group of resultant measured values as theactual measured value.

In step S13, the storage unit 13 of the machine learning device 10 usesthe measured data group acquired by the measured data acquisition unit11 as input data, uses the thermal displacement actual measured valueabout the machine element acquired by the thermal displacementacquisition unit 12 as a label, and stores the input data and the labelin a pair associated with each other as teaching data.

In step S14, the calculation formula learning unit 14 of the machinelearning device 10 performs machine learning based on the teaching data.Specific exemplary methods of the machine learning will be describedlater.

In step S15, the calculation formula learning unit 14 of the machinelearning device 10 determines whether to finish the machine learning orto repeat the machine learning. A condition for finishing the machinelearning can be determined arbitrarily. If the machining learning isdetermined to be finished (S15: YES), the flow goes to step S16. If themachining learning is determined to be repeated (S15: NO), the flowreturns to step S11 and the same processing is repeated.

In step S16, the machine learning device 10 transmits a thermaldisplacement estimation calculation formula set by the machine learninghaving been performed before step S16 to each thermal displacementcompensation device 20 through the network 40.

The storage unit 13 of the machine learning device 10 stores the thermaldisplacement estimation calculation formula. By doing so, if a thermaldisplacement estimation calculation formula is requested from a newlyinstalled thermal displacement compensation device 20, the storedthermal displacement estimation calculation formula can be transmittedto this new thermal displacement compensation device 20. If new teachingdata is acquired, further machine learning can be performed with the newteaching data.

<Exemplary Method of Machine Learning>

As described above, in step S14 of FIG. 4 , the calculation formulalearning unit 14 performs the machine learning based on the teachingdata. Exemplary methods of the machine learning will be described indetail.

As a first method, a coefficient that minimizes a square error between athermal displacement estimated value and a thermal displacement actualmeasured value can be inferred and set by machine learning using theleast-square method. This thermal displacement estimated value iscalculated using a thermal displacement estimation calculation formulaY=a₁X₁+a₂X₂+ . . . a_(n)X_(n) based on multiple regression of ageneralized linear model. Here, Y is a thermal displacement estimatedvalue, X₁, X₂, . . . , X_(n) are corresponding measured data values, anda₁, a₂, . . . , a_(n) are coefficients determined by the multipleregression. More specifically, assuming that measured data is X_(k) anda label is Y_(L),

a group of coefficients a_(k) is determined that minimizes a total ofvalues about multiple teaching data pieces obtained from the followingformula 1. In this formula, k is a natural number, n is any integer, andk≤n.[Formula 1](Y _(L) −Y)=(Y _(L)−Σ_(k=1) ^(n) a _(k) X _(k))²  (1)

According to the first method, not normal multiple regression analysisbut multiple regression analysis giving consideration to an L2regularization term is feasible. Specifically, a coefficient thatminimizes a value obtained by adding the L2 regularization term to asquare error between a thermal displacement estimated value calculatedusing the thermal displacement estimation calculation formulaY=a₁X₁+a₂X₂+ . . . a_(n)X_(n) and a thermal displacement actual measuredvalue can be inferred and set by machine learning. Like in the foregoingcase, Y is a thermal displacement estimated value, X₁, X₂, . . . , X_(n)are corresponding measured data values, and a₁, a₂, . . . , a_(n) arecoefficients determined by the multiple regression giving considerationto the L2 regularization term. More specifically, assuming that measureddata is X_(k) and a label is Y_(L),

a group of coefficients a_(k) is determined that minimizes a total ofvalues about multiple teaching data pieces obtained from the followingformula 2. In this formula, n is a natural number and means the numberof measurement points of teaching data used for learning. Further, λ isa hyperparameter, which is a parameter that is set in advance beforemachine learning begins.[Formula 2](Y _(L) −Y)²+Σ_(k=1) ^(n)(a _(k))²=(Y _(L)−Σ_(k=1) ^(n) X_(k))²+λΣ_(k=1) ^(n)(a _(k))²  (2)

According to the first method, sparse regularization is feasible. Forexample, multiple regression analysis giving consideration to an L1regularization term is feasible. More specifically, assuming thatmeasured data is X_(k) and a label is Y_(L),

a group of coefficients a_(k) is determined that minimizes a total ofvalues about multiple teaching data pieces obtained from the followingformula 3. In this formula, n is a natural number and means the numberof measurement points of teaching data used for learning. Further, λ isa hyperparameter, which is a parameter that is set in advance beforemachine learning begins. Setting λ at a larger value achieves the effectof increasing the number of terms in which a_(k) is zero.[Formula 3](Y _(L) −Y)²+λΣ_(k=1) ^(n) |a _(k)|=(Y _(L)−Σ_(k=1) ^(n) a _(k) X_(k))²+λΣ_(k=1) ^(n) |a _(k)|  (3)

Here, L2 regularization and L1 regularization are used as exemplaryregularizations. However, the regularizations are given as examples andnot limited to the above.

According to the first method, a first-order lag element in measureddata or a time shift element in the measured data is usable as inputdata for implementation of the aforementioned machine learning. Morespecifically, assuming that a thermal displacement estimated value attime t is Y(t) and a measured value from a sensor X_(k) at the time t isX_(k)(t), a thermal displacement estimation calculation formula using afirst-order lag element in measured data is expressed as follows:[Formula 4]Y(t)=Σ_(k=1) ^(n) a _(k)(Σ_(τ=0) ^(T) ^(k) X _(k)(t−τΔt _(k))e ^(−b)^(k) ^(τΔ) ^(k) )  (4)In this way, a coefficient a_(k), a coefficient b_(k), and a coefficientT_(k) are determined by machine learning. In this formula, Δt_(k) issampling time of a measured value from the sensor X_(k).

Assuming that a thermal displacement estimated value at the time t isY(t) and a measured value from the sensor X_(k) at the time t isX_(k)(t), a thermal displacement estimation formula using a time shiftelement in the measured data is expressed as follows:[Formula 5]Y(t)=Σ_(k=1) ^(n)Σ_(τ=0) ^(T) ^(k) a _(kτ) X _(k)(t−τΔt _(k))  (5)

In this way, a coefficient a_(k), and a coefficient T_(k) are determinedby machine learning. In this formula, Δt_(k) is sampling time of ameasured value from the sensor X_(k).

Various regularization terms such as an L1 regularization term and an L2regularization term may be added to learning while a first-order lagelement in measured data or a time shift element in the measured data isused. In this case, regularization terms corresponding to variousparameters such as a_(k), a_(kτ), b_(k), and T_(k) are added.

As a second method, machine learning using a known neural network isfeasible. For example, a single-layer neural network such as that shownin FIG. 5 is usable. Referring to FIG. 5 , a spindle thermaldisplacement estimated value is determined based on temperature data A,temperature data B, temperature data C, and operating state data A.Further, a feed axis thermal displacement estimated value is determinedbased on temperature data B, temperature data D, and operating statedata B. However, this is not the only case but is given as an example.

Multi-layer neural networks such as those shown in FIGS. 6A and 6B arealso usable. In particular, a recurrent neural network such as thatshown in FIG. 6A is used effectively in which an output from anintermediate layer is simultaneously input to the intermediate layer.Further, a time-delay feed-forward neural network such as that shown inFIG. 6B is also used effectively in which history data pieces covering apredetermined period of time from the past to the present includingtemperature data A_(t), temperature data_(At-1), and temperaturedata_(At-2), for example, are used simultaneously as input values. Datato be input to the neural network may be the foregoing time shiftelement in measured data (a first-order lag element in the measured dataand/or a time shift element in the measured data). For learning usingthe neural network, various regularization terms such as an L2regularization term, for example, may be added to the learning. Only oneintermediate layer is shown in each of FIGS. 6A and 6B. However, this isnot the only number of intermediate layers, and any number ofintermediate layers can be set. Referring to FIG. 6A, the temperaturedata A, the temperature data B, and the operating state data A areinput, and a spindle thermal displacement estimated value and a feedaxis thermal displacement estimated value are output. However, this isnot the only case but is given as an example. Referring to FIG. 6B, thetemperature data A_(t), temperature data_(At-1), and temperaturedata_(At-2) are input, and a spindle thermal displacement estimatedvalue and a feed axis thermal displacement estimated value are output.However, this is not the only case but is given as an example.

<Operation of Compensation>

The operation of compensation in the thermal displacement compensationsystem 100 according to this embodiment will be described next. FIG. 7is a flowchart showing the operation of the compensation by the thermaldisplacement compensation device 20.

In step S21, based on a thermal displacement estimation calculationformula set by the machine learning device 10, the compensation valuecalculation unit 22 calculates a compensation value corresponding to thethermal displacement of a machine element calculated from a measureddata group.

In step S22, the compensation unit 24 compensates the machine positionof the machine element based on the compensation value about the machineelement calculated by the compensation value calculation unit 22,thereby offsetting the thermal displacement. Unlike the illustration inFIG. 7 , the compensation unit 24 may transmit the compensation valueabout the machine element to the controller 30 in step S22. Morespecifically, the compensation unit 24 may compensate a coordinateposition output from the program reading and interpretation unit 32 ofthe controller 30 using this compensation value about the machineelement, and then output position command data to the motor control unit33. Alternatively, the compensation unit 24 may compensate the machiningprograms 31 in advance using this compensation value, and then executethe resultant machining programs 31.

<Effect Achieved by First Embodiment>

As described above, in this embodiment, the machine learning device 10is capable of optimizing a thermal displacement estimation calculationformula by machine learning used for estimating the thermal displacementof a machine element to be thermally expanded in the machine tool 35based on a measured data group containing temperature data about themachine element and its surroundings and/or operating state data aboutthe machine element.

Temperature change at each point where measured data is to be acquiredis delayed by heat transfer. Then, the temperature change is reflectedin thermal displacement. Thus, the machine learning technique allowingfor the delay is effective.

A thermal displacement estimation calculation formula and a compensationformula based on the thermal displacement estimation calculation formulacan be provided with increased accuracy by means of tuning in responseto the operating environment of the machine tool 35 or the type of themachine tool 35.

Second Embodiment

A second embodiment of the present invention will be described belowbased on the drawings. FIG. 8 is a block diagram showing a machinelearning device according to this embodiment in detail. FIG. 9 is aflowchart showing the operation of contribution determination by themachine learning device according to this embodiment. FIG. 10 is aflowchart showing the operation of optimized measured data groupselection by the machine learning device according to this embodiment.

<Configuration of Thermal Displacement Compensation System 100A>

As shown in FIG. 8 , a thermal displacement compensation system 100Aaccording to the second embodiment differs from the thermal displacementcompensation system 100 according to the first embodiment in that amachine learning device 10A according to the second embodiment includesa contribution determination unit 15 and an optimized measured dataselection unit 16 in addition to the components of the machine learningdevice 10 according to the first embodiment. The other structures of thesecond embodiment are basically the same as the aforementionedstructures of the first embodiment. Thus, common members are identifiedby the same signs and will not be described below.

The contribution determination unit 15 determines a contribution toestimation of the thermal displacement of each measured data in ameasured data group. More specifically, the contribution determinationunit 15 determines the contribution of measured data as a contributioncalculation target based on a difference between a first error (absolutevalue) and a second error (absolute value). The first error is an errorbetween a first thermal displacement estimated value and a thermaldisplacement actual measured value. The first thermal displacementestimated value is calculated using a first thermal displacementestimation calculation formula set by machine learning based on a firstmeasured data group containing the measured data as a contributioncalculation target. The second error is an error between a secondthermal displacement estimated value and a thermal displacement actualmeasured value. The second thermal displacement estimated value iscalculated using a second thermal displacement estimation calculationformula set by machine learning based on a second measured data groupfrom which the measured data as a contribution calculation target hasbeen excluded. More specifically, the contribution of the measured dataas a contribution calculation target can be determined to be larger witha larger difference between the first error and the second error. Adifference between the first error and the second error is preferablydetermined based on a group of the first errors and a group of thesecond errors corresponding to multiple groups of teaching data. In thiscase, an average or a maximum of differences between the first errorsand the second errors is usable, for example.

The optimized measured data selection unit 16 selects an optimizedmeasured data group containing a combination of a predetermined numberof measured data pieces belonging to a measured data group currentlyacquired and from which measured data of a small contribution has beenexcluded, for example. “The number of measured data pieces” mentionedherein means the number of types of measured data pieces differingbetween sensors used for obtaining the measured data pieces, forexample. More specifically, the optimized measured data selection unit16 selects a first measured data group by excluding measured data withthe smallest contribution as determined by the contributiondetermination unit 15 from the measured data group currently acquired.Next, the optimized measured data selection unit 16 selects an (i+1)-thmeasured data group by excluding measured data with the smallestcontribution as determined by the contribution determination unit 15from an i-th (1≤i) measured data group. The optimized measured dataselection unit 16 makes this selection repeatedly to select theoptimized measured data group containing the predetermined number ofmeasured data pieces. Here, i is a natural number.

<Operation of Contribution Determination>

The operation of determining the contribution of measured data in ameasured data group by the machine learning device 10A will be describednext. FIG. 9 is a flowchart showing the operation of the contributiondetermination by the machine learning device 10A.

In step S31, the calculation formula learning unit 14 sets the firstthermal displacement estimation calculation formula based on the firstmeasured data group containing all measured data pieces and a thermaldisplacement actual measured value by following the flow illustrated inFIG. 4 .

In step S32, the contribution determination unit 15 calculates a firstthermal displacement estimated value using the first thermaldisplacement estimation calculation formula.

In step S33, the contribution determination unit 15 calculates the firsterror (absolute value) showing an error between the first thermaldisplacement estimated value and the thermal displacement actualmeasured value.

In step S34, the calculation formula learning unit 14 sets the secondthermal displacement estimation calculation formula based on the secondmeasured data group from which measured data as a contributioncalculation target has been excluded and a thermal displacement actualmeasured value by following the flow illustrated in FIG. 4 .

In step S35, the contribution determination unit 15 calculates thesecond thermal displacement estimated value using the second thermaldisplacement estimation calculation formula.

In step S36, the contribution determination unit 15 calculates thesecond error (absolute value) showing an error between the secondthermal displacement estimated value and the thermal displacement actualmeasured value.

Steps S31 to S36 may be executed in parallel as shown in FIG. 9 , or maybe executed continuously.

In step S37, the contribution determination unit 15 determines thecontribution of the measured data as a contribution calculation targetbased on a difference between the first error and the second error. Morespecifically, the contribution of the measured data as a contributioncalculation target can be determined to be larger with a largerdifference between the first error and the second error.

<Operation of Optimized Measured Data Group Selection>

Described next is the operation by the machine learning device 10A forselecting an optimized measured data group containing a predeterminednumber of measured data pieces by excluding measured data of a smallcontribution. FIG. 10 is a flowchart showing the operation of theoptimized measured data group selection by the machine learning device10A.

In step S41, the optimized measured data selection unit 16 sets thenumber of measured data pieces to be ultimately used.

The number of measured data pieces to be ultimately used is set to besmaller than the original number of measured data pieces.

In step S42, the contribution determination unit 15 determines thecontribution of each measured data forming a measured data groupcurrently acquired by following the flow illustrated in FIG. 9 .

In step S43, the optimized measured data selection unit 16 excludesmeasured data with the smallest contribution from the measured datagroup currently acquired, and then determines the resultant measureddata group to be the “first measured data group.”

In step S44, the optimized measured data selection unit 16 sets aninitial value 1 for i.

In step S45, the optimized measured data selection unit 16 selects ani-th measured data group.

In step S46, the contribution determination unit 15 determines thecontribution of each measured data forming the i-th measured data groupby following the flow illustrated in FIG. 9 .

In step S47, the optimized measured data selection unit 16 excludesmeasured data with the smallest contribution from the i-th measured datagroup, and then determines the resultant measured data group to be the“(i+1)-th measured data group.”

In step S48, the optimized measured data selection unit 16 determineswhether the number of measured data pieces in the “(i+1)-th measureddata group” is equal to the number of measured data pieces set in stepS41. If this number of measured data pieces is equal to the originallyset number (S48: YES), the flow is finished. Specifically, the “(i+1)-thmeasured data group” at the finish of the process in step S48 becomesfunctional as an optimized measured data group. If the determined numberof measured data pieces is not equal to the originally set number (S48:NO), the flow goes to step S49.

In step S49, the optimized measured data selection unit 16 increments iby one. Then, the flow returns to step S45.

<Effect Achieved by Second Embodiment>

As described above, in addition to the effect achieved by the firstembodiment, the second embodiment achieves streamlining of a measureddata group by excluding measured data of a small contribution from themeasured data group.

As described above, the sensors connected to the terminals of thecontroller 30 are removable. Thus, a sensor that contributes little toaccuracy increase may be removed or the position of this sensor may bechanged. By doing so, compensation can be made with a high degree ofaccuracy using sensors of a reduced number. The reduction in the numberof sensors leads to cost reduction or ease of maintenance. Inparticular, highly accurate compensation can be realized with sensors ofa reduced number by providing a large number of sensors and acquiringmeasured data in advance, then calculating contributions by makingautomatic analysis by machine learning, and removing a sensor of a smallcontribution.

Third Embodiment

A third embodiment of the present invention will be described belowbased on the drawings. FIG. 11 is a block diagram showing a machinelearning device according to this embodiment in detail. FIG. 12 is aflowchart showing the operation of detection of measured data that donot contribute to accuracy increase by the machine learning deviceaccording to this embodiment.

<Configuration of Thermal Displacement Compensation System 100B>

As shown in FIG. 11 , a thermal displacement compensation system 100Baccording to the third embodiment differs from the thermal displacementcompensation system 100 according to the first embodiment in that amachine learning device 10B includes a detection unit 17 in addition tothe components of the machine learning device 10. The other structuresof the third embodiment are basically the same as the aforementionedstructures of the first embodiment. Thus, common members are identifiedby the same signs and will not be described below. The third embodimentis to detect measured data that do not contribute to accuracy increaseby using sparse regularization learning.

The detection unit 17 detects measured data that do not contribute toincrease in the accuracy of thermal displacement estimation based on athermal displacement estimation formula set by the sparse regularizationlearning.

<Operation of Detection>

The operation of determining the contribution of measured data in ameasured data group by the machine learning device 10B will be describednext. FIG. 12 is a flowchart showing the operation of the contributiondetermination by the machine learning device 10B.

In step S51, the measured data acquisition unit 11 of the machinelearning device 10B acquires a measured data group from the controller30. More specifically, the measured data acquisition unit 11 acquirestemperature data about a machine element in the machine tool 35 and itssurroundings and/or operating state data about the machine tool 35.

In step S52, the thermal displacement acquisition unit 12 of the machinelearning device 10B acquires a thermal displacement actual measuredvalue about the machine element in the machine tool 35 measured with aneddy-current sensor, for example. As a specific example, the thermaldisplacement acquisition unit 12 may measure a component in an X-axisdirection, a component in a Y-axis direction, and a component in aZ-axis direction of the thermal displacement, and acquire a group ofresultant measured values as the actual measured value.

In step S53, the storage unit 13 of the machine learning device 10B usesthe measured data group acquired by the measured data acquisition unit11 as input data, uses the thermal displacement actual measured valueabout the machine element acquired by the thermal displacementacquisition unit 12 as a label, and stores the input data and the labelin a pair associated with each other as teaching data.

In step S54, the calculation formula learning unit 14 of the machinelearning device 10B performs machine learning through sparseregularization using the teaching data.

In step S55, the detection unit 17 detects measured data X_(k) to make acoefficient a_(k) zero. By doing so, the detection unit 17 detects themeasured data that do not contribute to increase in the accuracy ofthermal displacement estimation based on a thermal displacementestimation formula set by the sparse regularization learning.

The machine learning device 10A according to the second embodiment canoptimize a measured data group by using the detection unit 17 incombination with the optimized measured data selection unit 16 insteadof the contribution determination unit 15. More specifically, thedetection unit 17 detects measured data that do not contribute toincrease in the accuracy of thermal displacement estimation such asmeasured data to make the coefficient a_(k) zero. The optimized measureddata selection unit 16 excludes the measured data that do not contributeto increase in the accuracy of thermal displacement estimation from ameasured data group currently acquired. By doing so, a streamlinedmeasured data group can be selected.

<Effect Achieved by Third Embodiment>

As described above, the third embodiment achieves an effect comparableto that achieved by the second embodiment.

Other Embodiments

While the foregoing embodiments are preferred embodiments of the presentinvention, these embodiments do not limit the scope of the presentinvention. The present invention is feasible as embodiments to whichvarious changes are added within a range not deviating from thesubstance of the present invention.

[First Modification]

In the embodiments, a thermal displacement estimation calculationformula is described as a polynomial formulated based on multipleregression of a generalized linear model. However, this is not the onlycase but the thermal displacement estimation calculation formula may beformulated based on multiple regression of a non-linear model.

[Second Modification]

The techniques in the foregoing embodiments are to optimize a measureddata group by deleting measured data. However, this is not the only casebut the measured data group may be optimized by adding measured data.More specifically, if the degree of accuracy of a thermal displacementestimation calculation formula set as a result of machine learning isless than a threshold, measured data may be added. Further, aftercertain measured data is deleted, different measured data may be added.In particular, if a sensor is added by a maintenance operator or an enduser of a machine tool, the accuracy of thermal displacementcompensation is increased by means of automatic tuning of a compensationformula based on a thermal displacement estimation calculation formula.In order to increase the accuracy of thermal displacement compensation,for example, machine learning may be performed using a measured datagroup obtained by changing the position of a temperature sensor, forexample. In this case, a determination can also be made as to whetheraccuracy is increased by evaluating a difference between an errorbetween a thermal displacement estimated value calculated using athermal displacement estimation formula obtained after the positionchange and a thermal displacement actual measured value, and an errorbetween a thermal displacement estimated value calculated using athermal displacement compensation formula obtained based on machinelearning using a measured data group before the position change and athermal displacement actual measured value.

[Third Modification]

In the foregoing embodiments, the machine tool 35 is described as acutting machine. However, the machine tool 35 is not limited to thecutting machine. The machine tool 35 may also be a wire dischargemachine or a laser machine, for example.

[Fourth Modification]

The controller 30 may be configured to include the thermal displacementcompensation device 20. The controller 30 may alternatively beconfigured to include the machine learning device 10, 10A, or 10B.

[Fifth Modification]

Each of the machine learning devices 10, 10A, and 10B in the foregoingembodiments may be configured as a computer system including a CPU. Inthis case, the CPU reads a program from a storage unit such as a ROM,for example, and follows the read program, thereby causing the computerto function as the measured data acquisition unit 11, the thermaldisplacement acquisition unit 12, the storage unit 13, the calculationformula learning unit 14, the contribution determination unit 15, theoptimized measured data selection unit 16, and the detection unit 17.

EXPLANATION OF REFERENCE NUMERALS

-   10 10A 10B Machine learning device-   11 Measured data acquisition unit-   12 Thermal displacement acquisition unit-   13 Storage unit-   14 Calculation formula learning unit-   15 Contribution determination unit-   16 Optimized measured data selection unit-   17 Detection unit-   20 Thermal displacement compensation device-   22 Compensation value calculation unit-   24 Compensation unit-   30 Controller-   35 Machine tool-   40 Network-   100 100A 100B Thermal displacement compensation system

What is claimed is:
 1. A machine learning device that optimizes, bymachine learning, a calculation formula used for estimating the thermaldisplacement of a machine element to be thermally expanded in a machinetool based on a measured data group containing temperature data aboutthe machine element and its surroundings and/or operating state dataabout the machine element, the machine learning device comprising: ameasured data acquisition unit that acquires the measured data group; athermal displacement acquisition unit that acquires a thermaldisplacement actual measured value about the machine element; a storageunit that uses the measured data group acquired by the measured dataacquisition unit as input data, uses the thermal displacement actualmeasured value about the machine element acquired by the thermaldisplacement acquisition unit as a label, and stores the input data andthe label in association with each other as teaching data; a calculationformula learning unit that performs machine learning based on themeasured data group and the thermal displacement actual measured valueabout the machine element, thereby setting a thermal displacementestimation calculation formula used for calculating the thermaldisplacement of the machine element based on the measured data group;and a contribution determination unit that determines a contribution toestimation of the thermal displacement of measured data in the measureddata group, wherein the calculation formula learning unit sets thethermal displacement estimation calculation formula based on adifference between a thermal displacement estimated value about themachine element calculated by substituting the measured data group in apredetermined period stored as the teaching data in the storage unitinto the thermal displacement estimation calculation formula and thethermal displacement actual measured value about the machine element inthe predetermined period stored as the label in the storage unit, andthe contribution determination unit determines the contribution ofmeasured data as a contribution calculation target based on a differencebetween a first error and a second error, the first error being an errorbetween a first thermal displacement estimated value and a thermaldisplacement actual measured value, the first thermal displacementestimated value being calculated using a first thermal displacementestimation calculation formula set based on a measured data groupcontaining the measured data as a contribution calculation target, thesecond error being an error between a second thermal displacementestimated value and a thermal displacement actual measured value, thesecond thermal displacement estimated value being calculated using asecond thermal displacement estimation calculation formula set based ona second measured data group from which the measured data as acontribution calculation target has been excluded.
 2. The machinelearning device according to claim 1, further comprising an optimizedmeasured data selection unit that selects an optimized measured datagroup containing a combination of measured data pieces belonging to ameasured data group currently acquired and achieving an optimum degreeof accuracy using a predetermined number of measured data pieces,wherein the optimized measured data selection unit selects a firstmeasured data group by excluding measured data with a smallestcontribution as determined by the contribution determination unit fromthe measured data group currently acquired, and the optimized measureddata selection unit selects an (i+1)-th measured data group by excludingmeasured data with a smallest contribution as determined by thecontribution determination unit from an i-th (1≤i) measured data group,and makes this selection repeatedly, thereby selecting the optimizedmeasured data group containing the predetermined number of measured datapieces.
 3. The machine learning device according to claim 1, wherein thethermal displacement estimation calculation formula uses a first-orderlag element in measured data in the measured data group.
 4. The machinelearning device according to claim 1, wherein the thermal displacementestimation calculation formula uses a time shift element in measureddata in the measured data group.
 5. The machine learning deviceaccording to claim 1, wherein the thermal displacement estimationcalculation formula is set based on machine learning using a neuralnetwork.
 6. The machine learning device according to claim 1, whereinthe calculation formula learning unit sets the thermal displacementestimation calculation formula based on machine learning using multipleregression analysis giving consideration to an L2 regularization term.7. The machine learning device according to claim 1, wherein thecalculation formula learning unit sets the thermal displacementestimation calculation formula using sparse regularization learning. 8.The machine learning device according to claim 7, further comprising adetection unit that detects measured data in the measured data groupthat do not contribute to increase in the accuracy of thermaldisplacement estimation, wherein the detection unit detects the measureddata based on the thermal displacement estimation calculation formulaset by the sparse regularization learning.
 9. The machine learningdevice according to claim 1, wherein the machine learning device isincorporated in a controller for the machine tool.
 10. A thermaldisplacement compensation device for a machine tool, comprising: acompensation value calculation unit, wherein, based on the thermaldisplacement estimation calculation formula set by the machine learningdevice according to claim 1, the compensation value calculation unitcalculates a compensation value corresponding to the thermaldisplacement of the machine element calculated from the measured datagroup; and a compensation unit that compensates the machine position ofthe machine element based on the compensation value about the machineelement calculated by the compensation value calculation unit.
 11. Thethermal displacement compensation device according to claim 10, whereinthe thermal displacement compensation device is incorporated in acontroller for the machine tool.